@extends('admin.layout.app')

@section('title')
    年度评分
@endsection

@section('content') 
	@component('admin.components.nav') 
	@endcomponent
		<!--main-->
		<main>
			<div class="container">
				<div class="breadcrumb">
					<div class="row">
						<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
							<h3><a href="/years">年度评分</a><i style="padding: 0 12px;">></i><span>评分</span></h3>
						</div>
					</div>
				</div>
				<div class="data-table table-responsive">
					<table class="table table-striped table-hover">
						<thead>
							<tr>
								<th>编号</th>
								<th>姓名</th>
								<th>部门</th>
								<th>职位</th>
								<th>评分</th>
							</tr>
						</thead>
						<tbody>
							<tr v-for="(item,index) in list">
								<th scope="row">@{{item.id}}</th>
								<td>@{{item.name}}</td>
								<td>@{{item.department_name}}</td>
								<td>@{{item.post_name}}</td>
								<td>
									<input class="form-control" type="number" min="0" max="100" name="" v-model="formData.values[index]" @change="checkInput(index)"/>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="action-panel">
					<div class="row">
						<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
							<button class="btn btn-primary" @click="checkForm">提交评分</button>
						</div>
						<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8">
						</div>
					</div>
				</div>
				<div class="modal fade modal-hint" tabindex="-1" role="dialog" id="modal-hint">
					<div class="modal-dialog" role="document">
						<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
								<h4 class="modal-title"></h4>
							</div>
							<div class="modal-body">
								<p class="lead text-center">提交后不可修改，是否确认提交评分？</p>
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-primary" data-dismiss="modal" aria-label="Close">返回</button>
								<button type="button" class="btn btn-primary" data-loading-text="正在提交" @click="submitForm">确认提交</button>
							</div>
						</div>
						<!-- /.modal-content -->
					</div>
					<!-- /.modal-dialog -->
				</div>
				<!-- /.modal -->
			</div>
		</main>
@endsection

@section('script')
		<script src="/js/node_modules/urljs/src/url.min.js" type="text/javascript"></script>
		<script type="text/javascript">
			var activeIndex = 3
		</script>
		<script src="/admin/js/nav.js" type="text/javascript"></script>
		<script src="/admin/js/year_form.js" type="text/javascript"></script>
@endsection